package com.bw.home.service

import com.bw.home.api.DanMuApi
import com.bw.home.entity.DanMuEntity
import com.bw.lib_net.BaseRes
import com.bw.lib_net.RetrofitFactory
import retrofit2.http.Body
import retrofit2.http.Query

class DanMuService {
    private val api: DanMuApi

    init {
        api = RetrofitFactory.getRetrofit().create(DanMuApi::class.java)
    }

    //获取弹幕
    suspend fun getDanMu(type: Int, id: String): BaseRes<List<DanMuEntity>> {
        return api.getDanMu(type, id)
    }

    //发送弹幕
    suspend fun sendDanMu(entity: DanMuEntity): BaseRes<DanMuEntity> {
        return api.sendDanMu(entity)
    }

    //删除弹幕
    suspend fun deleteDanMu(id: Int): BaseRes<Boolean> {
        return api.deleteDanMu(id)
    }
}